package com.shoping.web.fegin;

import com.shoping.common.response.ResponseData;
import com.shoping.web.po.request.OrderPo;
import com.shoping.web.po.response.OrderDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "shopping-order-service")
public interface OrderControllerClient {

    @GetMapping("/api/order/{id}")
    ResponseData<OrderDto> getOrder(@PathVariable("id") Integer id);

    @PostMapping("/api/order")
    ResponseData<OrderDto> saveOrder(@RequestBody @Validated OrderPo orderPo);
}
